	.file "sub.s"
	.text
	.global FindMax
	.type FindMax, @function
FindMax:
	pushq	%rbp
	movq	%rsp, %rbp

	#int FindMax(int *data, int count)
	#data: %rdi
	#count: %esi
	
	decl	%esi
	movl	$1, %edx
	movl	(%rdi), %eax
	leaq	4(%rdi), %rcx
1:
	cmpl	%esi, %edx
	jge	Done
	cmpl	(%rcx), %eax
	jge	Next
	movl	(%rcx), %eax
Next:
	addq	$4, %rcx
	incl	%edx
	jmp	1b
Done:
	leaveq
	retq
